$(function () {
    $("#undel").on("click",function () {
      //eg1
      layer.confirm('是否退出?', { icon: 3, title: '提示' }, function (index) {
        //do something
      if (index !== 0) {
        location.href = "/admin/login.html"
        localStorage.removeItem("mytoken")
      }
        layer.close(index);
      });  
    })
  })